﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="pgEnviarDoc.aspx.cs" Inherits="EGuayas.Web.EGlobal.pgEnviarDoc" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link  href="~/Resources/css/Style.css"  rel="stylesheet" />
    <!-- Load Ext JS --> 
    <script src="../Resources/js/Global.js"></script>
   
</head>
<body>  
    
        <ext:ResourceManager ID="pgIdCategManager" runat="server" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
            <Items>
                <ext:FormPanel ID="FormPanel1" runat="server" Region="Center" Layout="VBoxLayout" >
                        <LayoutConfig>
                                <ext:VBoxLayoutConfig Align="Stretch" />
                        </LayoutConfig>
                        <Items>
                             <ext:FormPanel
                                ID="frmSettings"
                                runat="server" 
                                Title="Documentos" 
                                Icon="PageWhiteStack" 
                                Margins="5 5 5 5" 
                                Flex="1"
                                Layout="FitLayout"
                                BodyBorder="0"                          
                                Collapsible="true">                           
                               
                                <Items>
                                            <ext:GridPanel
                                                ID="gpDocumentosLoad"
                                                runat="server"                                           
                                                Height="90">
                                                <Store>
                                                    <ext:Store ID="Store2" runat="server">
                                                        <Model>
                                                            <ext:Model ID="Model2" runat="server" IDProperty="Id">
                                                                <Fields>
                                                                    <ext:ModelField Name="FaseLicId" Type="String" />
                                                                    <ext:ModelField Name="FechaCreacion" Type="Date" />
                                                                    <ext:ModelField Name="FechaFirmado" Type="Date" />
                                                                    <ext:ModelField Name="Firmado" Type="String" />
                                                                    <ext:ModelField Name="Id" Type="String" />
                                                                    <ext:ModelField Name="Descripcion" Type="String" />
                                                                    <ext:ModelField Name="Nombre" Type="String" />
                                                                    <ext:ModelField Name="PersonaId" Type="String" />
                                                                    <ext:ModelField Name="PersonaNombres" Type="String" />
                                                                    <ext:ModelField Name="Referencia" Type="String" />
                                                                    <ext:ModelField Name="RequiereFirmar" Type="String" />
                                                                    <ext:ModelField Name="Ruta" Type="String" />
                                                                    <ext:ModelField Name="TipoDocumento" Type="String" />
                                                                    <ext:ModelField Name="SubirNuevo" Type="String" />
                                                                    <ext:ModelField Name="Version" Type="Int" />
                                                                </Fields>
                                                            </ext:Model>
                                                        </Model>                                      
                                                        <Proxy>
                                                            <ext:PageProxy DirectFn="App.direct.BindData">
                                                                <Reader>
                                                                    <ext:JsonReader></ext:JsonReader>
                                                                </Reader>
                                                            </ext:PageProxy>
                                                        </Proxy>
                                                    </ext:Store>
                                                </Store>
                                                <ColumnModel ID="ColumnModel2" runat="server">
                                                    <Columns>
                                                        <ext:Column  runat="server" Text="Id" DataIndex="Id" Flex="1" Hidden="true"/>
                                                        <ext:Column  runat="server" Text="Nombre" DataIndex="Nombre" Flex="1"/>
                                                       
                                                        <ext:DateColumn runat="server" Text="Fecha" Width="95" DataIndex="FechaCreacion" Format="dd-m-yy" />
                                                        <ext:CommandColumn ID="CommandColumn0" runat="server" Width="120" Text="">
                                                                    <Commands>
                                                                        <ext:GridCommand Icon="TabEdit" CommandName="View" Text="Enviar a Revizar">
                                                                            <ToolTip Text="Revizar" />
                                                                        </ext:GridCommand>
                                                                    </Commands>
                                                                    <PrepareToolbar />
                                                                    <Listeners>
                                                                          <Command Handler="pgFn.ShowViewDetailPanel(record);" >                                                                             
                                                                           </Command>
                                                                    </Listeners>                                                       
                                                       </ext:CommandColumn>
                                                         <ext:Column ID="Column1"  runat="server" Text="Decripción" DataIndex="Descripcion" />                                                                                 
                                                    </Columns>                                                    
                                                </ColumnModel>
                                                                                                       
                                            </ext:GridPanel>
                                   </Items>
                            </ext:FormPanel>                           
                       </Items>
                       <BottomBar>
                         <ext:StatusBar 
                                ID="StatusBar2" 
                                runat="server"
                                StatusAlign="Left">
                                <Items>                                
                                    <ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" Text="" Cls="ux-bold-text-item"  Margin="15"/>
                                </Items>
                            </ext:StatusBar>
                        </BottomBar>
           </ext:FormPanel>
                
           <ext:Window 
            ID="winVisor" 
            runat="server"            
            Icon="TabEdit"
            Height="125" 
            Width="350"
            ButtonAlign="Center"
            BodyStyle="background-color: #fff;" 
            BodyPadding="5"            
            hidden="true" 
            closeaction="Hide">
            <Content>
                <ext:FormPanel 
                    ID="forPanelRevisar" 
                    Border="false"
                    runat="server"
                    Width="330"            
                    BodyPadding="5"
                    Layout="Form">
                    <FieldDefaults LabelWidth="75" LabelPad="20" LabelSeparator="" />
                    <Items> 
                        <ext:Panel ID="Panel2" runat="server" Border="false" Layout="Form" ColumnWidth=".5" LabelAlign="Top">
                            <Defaults>
                                <ext:Parameter Name="AllowBlank" Value="false" Mode="Raw" />
                                <ext:Parameter Name="MsgTarget" Value="side" />
                            </Defaults>
                            <Items>   
                                             <ext:Hidden Text="" ID="hdDocRevizarId"  Name="Id"    runat  ="server"></ext:Hidden>
                                             <ext:ComboBox ID="cbxRol" 
                                                runat="server"
                                                Width="250"
                                                FieldLabel="Rol" 
                                                Editable="false"
                                                DisplayField="Nombre"
                                                ValueField="Id"
                                                TypeAhead="true" 
                                                QueryMode="Local"
                                                ForceSelection="true"
                                                TriggerAction="All"
                                                EmptyText="Seleccione"
                                                SelectOnFocus="true">                        
                                                <Store>
                                                    <ext:Store ID="stoRol" runat="server">
                                                        <Model>
                                                            <ext:Model ID="Model1" runat="server">
                                                                <Fields>
                                                                    <ext:ModelField Name="Id" />
                                                                    <ext:ModelField Name="Nombre" />                                               
                                                                </Fields>
                                                            </ext:Model>
                                                        </Model>            
                                                    </ext:Store>
                                                </Store>
                                                <ListConfig>
                                                    <ItemTpl ID="ItemTpl1" runat="server">
                                                        <Html>
						                                    <div class="list-item">
							                                           {Nombre}
						                                    </div>
				                                        </Html>    
                                                    </ItemTpl>
                                                </ListConfig>
                                            </ext:ComboBox>
                                </Items>
                        </ext:Panel>
                    </Items>
                    <Listeners>
                        <ValidityChange Handler="#{btnRevisarOk}.setDisabled(!valid);" />
                    </Listeners>
                </ext:FormPanel>
            </Content>
            <Buttons>
                <ext:Button ID="btnRevisarOk" runat="server" Text="Aceptar">
                     <DirectEvents>
                        <Click OnEvent="btnRevisar_Click"  After="AppGlobalJs.closeWin(#{winVisor})" >
                                <ExtraParams>
                                    <ext:Parameter Name="hdDocRevizarId" Value="#{hdDocRevizarId}.getValue()"   Mode="Raw" /> 
                                    <ext:Parameter Name="hdcbxRol" Value="#{cbxRol}.getValue()"   Mode="Raw" />                                                               
                                </ExtraParams>	
                                <EventMask ShowMask="True"></EventMask>		    
                        </Click> 
                    </DirectEvents>  
                </ext:Button>
                 <ext:Button ID="btnWinComentarioCancel" runat="server" Text="Cancelar"  OnClientClick="AppGlobalJs.closeWin(#{winVisor})">
                    <Listeners>                    
                    </Listeners>
                </ext:Button>
            </Buttons>
            <Listeners>
                <BeforeHide Handler="#{forPanelRevisar}.getForm().reset();"></BeforeHide>              
            </Listeners>
        </ext:Window>
            </Items>
       </ext:Viewport>
   
    <ext:XScript ID="XScript1" runat="server">
        <script language="javascript" type="text/javascript">
            var pgFn    = new Object();
            //Mostrar panel detalles
            pgFn.ShowViewDetailPanel = function (record) {
                             #{forPanelRevisar}.getForm().loadRecord(record);
                AppGlobalJs.showWin(#{winVisor});
            }
       </script>
    </ext:XScript>     
</body>


</html>
